<!--考勤管理页-->
<template>
  <div style="height: 6vh;background-color:#fff;padding:10px 20px;">
    <el-menu mode="horizontal" router :default-active="$route.path">

      <el-menu-item index="/checking_set">班次设置</el-menu-item>
      <el-menu-item index="/checking_group">考勤组设置</el-menu-item>
      <el-menu-item index="/checking_vocation">假期设置</el-menu-item>
    </el-menu>
  </div>
  <!-- 考勤组列表 -->
  <el-card style="margin:20px;">
    <div style="display: flex;justify-content: space-between;">
      <span>考勤组列表</span>
      <div>
        <el-button type="primary" @click="beforeAddGroup">新增考勤组</el-button>
      </div>
    </div>
    <!--    新增考勤组弹窗-->
    <el-dialog v-model="dialogVisible" :title="dialogTitle">
      <el-form label-width="80px" label-position="top">
        <el-row :gutter="10">
          <el-col :span="12">
            <el-form-item label="考勤组名称">
              <el-input placeholder="请输入"
                        ></el-input>
            </el-form-item>
          </el-col>
          <el-col :span="12">
            <el-form-item label="参与人员">
              <el-input placeholder="请输入" ></el-input>
            </el-form-item>
          </el-col>
        </el-row>
        <el-row :gutter="10">
          <el-col :span="12">
            <el-form-item label="负责人">
              <el-input placeholder="请输入" ></el-input>
            </el-form-item>
          </el-col>
          <el-col :span="12">
            <el-form-item label="班次" label-position="top">
              <el-select placeholder="请选择">
                <el-option label="星期一(普通班次)" value="1"></el-option>
                <el-option label="星期二(普通班次)" value="2"></el-option>
                <el-option label="星期三(普通班次)" value="3"></el-option>
                <el-option label="星期四(普通班次)" value="4"></el-option>
                <el-option label="星期五(普通班次)" value="5"></el-option>
              </el-select>
            </el-form-item>
          </el-col>
        </el-row>
        <el-row :gutter="10">
          <el-col :span="12">
            <el-form-item label="考勤方式" label-position="top">
              <el-select placeholder="请选择">
                <el-option label="人脸考勤" value="1"></el-option>
                <el-option label="定位打卡" value="2"></el-option>

              </el-select>
            </el-form-item>
          </el-col>
          <el-col :span="12">
            <el-form-item label="更多设置">
              <el-input placeholder="请输入" ></el-input>
            </el-form-item>
          </el-col>

        </el-row>


      </el-form>
      <template #footer>
        <el-button @click="dialogVisible = false">取 消</el-button>
        <el-button type="primary" @click="dialogVisible = false">确 定</el-button>
      </template>
    </el-dialog>
    <el-table>
      <el-table-column type="index" label="序号" width="80" align="center"/>
      <el-table-column prop="brand" label="考勤组名称" align="center"/>
      <el-table-column prop="license" label="参与人数" align="center"/>
      <el-table-column prop="license" label="上下班次数" align="center"/>
      <el-table-column label="操作" align="center">
        <template #default="scope">
          <el-button link type="primary" size="small">编辑</el-button>
          <el-button link type="primary" size="small">删除</el-button>

        </template>
      </el-table-column>



    </el-table>
  </el-card>
</template>
<script setup>
import {ref} from "vue";

const dialogVisible = ref(false);
//定义变量控制dialog的标题
const dialogTitle = ref('新增考勤组');
const beforeAddGroup = () => {
  dialogVisible.value = true;
  dialogTitle.value = '新增考勤组';
  console.log(dialogTitle.value);
}


</script>